import { useState } from "react";
import { Contact } from "./interface";

interface ChatProps {
  contact: Contact;
}

function Chat({ contact }: ChatProps) {
  const [text, setText] = useState("");

  return (
    <section className="chat">
      <textarea value={text} placeholder={"Chat to " + contact.name} onChange={e => setText(e.target.value)} />
      <br />
      <button>发送给{contact.name}</button>
    </section>
  );
}

export default Chat;
